import {fetchGoodList} from '../../utils/api'
export default {
	namespaced: true,
	state: {
		cache:{}
	},
	mutations:{
		uptate( state,payload){
			// 改变find
			state.cache[payload.index]=payload.arr
			state.cache = JSON.parse(JSON.stringify(state.cache))

		},
		deletcll(state){
			state.cache={}
		}

	},
	actions:{
		getfind(store,payload){
			fetchGoodList({cate:payload.cate}).then(res=>{
				store.commit('uptate',{index:payload.index,arr:res.list})
			})
		}

	}
}
